from playwright.sync_api import BrowserContext, Browser

from model.ProConfModel import ProConfModel
from service.BaseService import BaseService
from service.djjx.httpServer import get_djjx_post_request


class DjjxService(BaseService):
    def __init__(self):
        super().__init__()
    def execute(self,browser:Browser ,context:BrowserContext, pro_config: ProConfModel, detail_url: str):
        # print(get_storage_path_by_pro(pro_config))
        # context = browser.new_context(storage_state=get_storage_path_by_pro(pro_config))
        # page = context.new_page()
        # print(context)
        # print(page.content())
        # return get_html_detail(page,detail_url)

        return  get_djjx_post_request(detail_url)